Skip to content

added more clarification #1395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

gabbyprecious
Copy link

No description provided.

@gabbyprecious gabbyprecious marked this pull request as draft March 30, 2022 13:41
@gabbyprecious
Copy link
Author

@ConorOkus please is this in line?

@codecov-commenter
Copy link

Codecov Report

Merging #1395 (a3820f5) into main (7671ae5) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1395      +/-   ##
==========================================
- Coverage   90.76%   90.76%   -0.01%     
==========================================
  Files          73       73              
  Lines       41195    41195              
  Branches    41195    41195              
==========================================
- Hits        37392    37391       -1     
- Misses       3803     3804       +1     
Impacted Files Coverage Δ
lightning/src/chain/mod.rs 61.11% <ø> (ø)
lightning/src/ln/functional_tests.rs 97.06% <0.00%> (-0.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7671ae5...a3820f5. Read the comment docs.

@@ -315,11 +315,12 @@ pub trait Watch<ChannelSigner: Sign> {
/// [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
/// [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
pub trait Filter {
/// Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
/// Registers interest in funding transactions to inform LDK that a channel
/// Funding transaction is transaction with `txid` and having an output with `script_pubkey` as
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to narrow the definition of this function to only funding transaction(s). Yes, it's true today, but specifying it in the docs and committing to it I don't think we want to do.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be a better description that clarifies and differentiates what it does with register_output

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key difference here is one looks at a given transaction being broadcasted, one looks for spends of a given output being broadcasted.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheBlueMatt, should I go with this;

/// Registers interest in transactions to inform LDK that a channel.
/// Transactions with txid and having an output with script_pubkey as
/// a spending condition.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think these functions should have any reference to what kind of transaction it is (channel/close/open/etc).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I should leave them at what they were?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean I do think they need to be clarified, because we've seen a good chunk of confusion on them, but it remains entirely unclear to me exactly how they should be clarified :/

/// a spending condition.
fn register_tx(&self, txid: &Txid, script_pubkey: &Script);

/// Registers interest in spends of a transaction output.
/// Registers interest in spends of a force close transaction.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't just about force-closure transactions - we also use it to detect normal closures, etc.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheBlueMatt is this a better description; Registers interest in spends of a closing transaction.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not "spends of a closing transaction", though, its "spends of a given outpoint", ie any time a given output is spent we care.

@TheBlueMatt
Copy link
Collaborator

Any interest in continuing to work on this, @gabbyprecious? Sorry it ended up being a bit unclear what the docs should say.

@gabbyprecious
Copy link
Author

@TheBlueMatt yes, is there any clarity on what it should say. Will also be checking other issues

@TheBlueMatt
Copy link
Collaborator

Sorry for the late reply, we had the lightning spec summit last week.

I don't have perfect clarity - I've seen a lot of user confusion on this API, so I think we do need to clarify, but its kinda unclear to me how to do so (without changing the definition/API contract here).

Do you find the meaning of register_tx clearer if we separate out the mention of the script from the first sentence? Maybe something like "Registers interest in a given transaction confirming. The txid of the transaction is provided, as well as a script_pubkey of an output in the transaction, useful for those using BIP 157/158 filters"?

@TheBlueMatt
Copy link
Collaborator

Any desire to keep working on this @gabbyprecious?

@gabbyprecious
Copy link
Author

Yes, if there's more clarity on it.

@TheBlueMatt
Copy link
Collaborator

Sorry for the delay in responding. Maybe we just include in the docs a specific contrast between the two methods. Ie in one of them write exactly how it differs from the other, noting that one is about spends and the other is about transactions themselves.

@TheBlueMatt
Copy link
Collaborator

Closing in favor of #3036

@TheBlueMatt TheBlueMatt closed this May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Further clarify register_tx/register_output distinction in docs
3 participants